const app = getApp()
Component({
  properties: {
    cardData: {
      type: Object,
      value: {},
      observer: function (newVal, oldVal) {
      }
    }
  },
  lifetimes: {
    attached() {
      // 在组件实例进入页面节点树时执行
      let userInfo = wx.getStorageSync('userInfo')
      let cardData = this.data.cardData||{}
      cardData.bgUrl = cardData.bgUrl || '../../images/bg_card.jpg'
      cardData = {...userInfo, ...this.data.cardData}
      console.log(cardData)
      this.setData({cardData})
    },
    detached() {
      // 在组件实例被从页面节点树移除时执行
    },
  }
})